﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WiimoteLib;

namespace IndoorPositionFinder
{
    public class Room
    {
        private List<PointF> points; // Points that defines the edges of the room
        private Dictionary<String, RoomWiimote> wiimotes;
        private List<RoomDoor> doors; //Doors included in a single room
        private List<RoomObject> roomObjects; // Objects included in the room
        
        /// <summary>
        /// Room Constructor. Initialize all the required components.
        /// </summary>
        public Room()
        {
            this.points = new List<PointF>();
            this.doors = new List<RoomDoor>();
            this.wiimotes = new Dictionary<string, RoomWiimote>();
            this.roomObjects = new List<RoomObject>();

        }
        #region General Getters/Setters
        public List<PointF> Points { get { return points; } set { points = value; } }
        public List<RoomDoor> Doors { get { return doors; } set { doors = value; } }
        public Dictionary<string, RoomWiimote> Wiimotes { get { return wiimotes; } set { wiimotes = value; } }
        public List<RoomObject> RoomObjects { get { return roomObjects; } set { roomObjects = value; } }
        public PointF maxPoints { 
            get {
                PointF maxPoint = new PointF();
                foreach (PointF point in this.points)
                {
                    if (point.X >= maxPoint.X)
                        maxPoint.X = point.X;
                    if (point.Y >= maxPoint.Y)
                        maxPoint.Y = point.Y;
                }            
                return maxPoint; 
            
            }
        }
        #endregion
    }
}
